package com.ruoyi.project.common.lesson.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.common.lesson.domain.ZyLesson;
import com.ruoyi.project.common.lesson.mapper.ZyLessonMapper;
import com.ruoyi.project.common.lesson.service.ILessonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * lessonService业务层处理
 * 
 * @author shixiangwen
 * @date 2020-06-03
 */
@Service
public class ZyLessonServiceImpl implements ILessonService {
	@Autowired
	private ZyLessonMapper lessonMapper;

	/**
	 * 查询lesson
	 * 
	 * @param id lessonID
	 * @return lesson
	 */
	@Override
	public ZyLesson selectLessonById(Long id) {
		return lessonMapper.selectLessonById(id);
	}

	/**
	 * 查询lesson列表
	 * 
	 * @param lesson lesson
	 * @return lesson
	 */
	@Override
	public List<ZyLesson> selectLessonList(ZyLesson lesson) {
		return lessonMapper.selectLessonList(lesson);
	}

	/**
	 * 新增lesson
	 * 
	 * @param lesson lesson
	 * @return 结果
	 */
	@Override
	public int insertLesson(ZyLesson lesson) {
		return lessonMapper.insertLesson(lesson);
	}

	/**
	 * 修改lesson
	 * 
	 * @param lesson lesson
	 * @return 结果
	 */
	@Override
	public int updateLesson(ZyLesson lesson) {
		return lessonMapper.updateLesson(lesson);
	}

	/**
	 * 删除lesson对象
	 * 
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deleteLessonByIds(String ids) {
		return lessonMapper.deleteLessonByIds(Convert.toStrArray(ids));
	}

	/**
	 * 删除lesson信息
	 * 
	 * @param id lessonID
	 * @return 结果
	 */
	@Override
	public int deleteLessonById(Long id) {
		return lessonMapper.deleteLessonById(id);
	}
}
